<?php

namespace App\Http\Controllers\Api;

use App\Models\UserNotification;
use Illuminate\Http\Request;

class NotificationController extends ApiBaseController
{
    public function lists(Request $request, UserNotification $model)
    {
        $data = $request->all();
        if ($vr = $this->verifyField($data, [
            'page' => 'bail|required|integer',    //页数
        ])) return $vr;
        $data['uid'] = $this->getUid($request);
        $data['lang'] = $this->getDefaultLang($request);
        $result = $model->history($data);
        return $this->success($result);
    }

    public function detail(Request $request, UserNotification $model)
    {
        $data = $request->all();
        if ($vr = $this->verifyField($data, [
            'id' => 'bail|required|integer',    //页数
        ])) return $vr;
        $data['uid'] = $this->getUid($request);
        $data['lang'] = $this->getDefaultLang($request);
        $result = $model->detail($data);
        return $this->success($result);
    }

}
